<?
require("config.php");

require($rela_path . "bin/country.php");


$location_status .= "| Edit";
$show_backnav = "subscription_menu";
$menuname = NULL;
$menutarget = NULL;

if (NULL!=$action){

	if ($Picture_name=="" || $Picture_name==NULL) $Picture_name=$old_Picture;

   $field = array(
	"email", 
	"name", 
	"date", 
	"company",
	"address",
	"city",
	"country",
	"messages",
	);


   $content = array(
	$Email,
	$Name,
	$Date,
	$Company,
	$Address,
	$City,
	$Country,
	$Messages,
	);

	$exp = "id=$id";

   myUpdate($table,$field,$content,$exp);


   header("location:" . $rela_path . "share/msg.php?v=342");

   exit();

}else{

  if (!checkRecord($table,$id)){

	header("location:" . $rela_path . "share/msg.php?v=9002");

	exit();
  
  }

}


$Query = "SELECT 
code,
email,
name,
company,
address,
city,
country,
messages,
date 
FROM $table WHERE id=$id LIMIT 1";

$r=myQuery($Query);

$Code=$r[0][0];
$Email=$r[0][1];
$Name=$r[0][2];
$Company=$r[0][3];
$Address=$r[0][4];
$City=$r[0][5];
$Country=$r[0][6];
$Messages=$r[0][7];
$Date=$r[0][8];

require($rela_path . "inc/header.php");

?>

<form action="" method="post" enctype="multipart/form-data" name="form1">
<input name="action" type="hidden" value="edit">
<input name="id" type="hidden" value="<?print($id)?>">




<table width="95%" border="0" align="center">
  <tr> 
    <td valign="top"> 
      <table border="0" cellspacing="5" cellpadding="1">
        <tr> 
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>

        <tr> 
          <td class="tdheader">Code :</td>
          <td><?print($Code)?></td>
        </tr>

        <tr> 
          <td class="tdheader">Name :</td>
          <td><input type="text" class="text" name="Name" size="40" value="<?print($Name)?>"></td>
        </tr>

        <tr> 
          <td class="tdheader">Subscriber's Email :</td>
          <td><input type="text" class="text" name="Email" size="40" value="<?print($Email)?>"></td>
        </tr>

        <tr> 
          <td class="tdheader">Subscription Date :</td>
          <td><input type="text" class="text" name="Date" size="40" value="<?print($Date)?>"></td>
        </tr>

        <tr> 
          <td class="tdheader">Company :</td>
          <td><input type="text" class="text" name="Company" size="40" value="<?print($Company)?>"></td>
        </tr>

        <tr> 
          <td class="tdheader">Address :</td>
          <td><textarea class="text" name="Address" cols="40" rows="5"><?print($Address)?></textarea></td>
        </tr>

        <tr> 
          <td class="tdheader">City :</td>
          <td><input type="text" class="text" name="City" size="40" value="<?print($City)?>"></td>
        </tr>

        <tr> 
          <td class="tdheader">Country :</td>
          <td><?print(FFPCountry($Country))?></td>
        </tr>

        <tr> 
          <td class="tdheader">Messages :</td>
          <td><textarea class="text" name="Messages" cols="40" rows="8"><?print($Messages)?></textarea></td>
        </tr>


        <tr> 
          <td>&nbsp;</td>
          <td><input type="image" src="../../images/bt_cancel.gif" onClick="Redirect('subscription_menu.php',1);return false;"> <input type="image" src="../../images/bt_save.gif">
          </td>
        </tr>
      </table>
      <p><br>
        <br>
        <br>
      <p><br>
        <br>
        <br>
        <br>
      <p>&nbsp; 
      <p>&nbsp; 
      <p>&nbsp; 
      <p>&nbsp; 
      <p>&nbsp; 
      <p>&nbsp; 
      <p>&nbsp; </td>
  </tr>
</table>
<br>
<br>
<br>
<?
require($rela_path . "inc/footer.php");
?>
